/**
 *  地址管理
 */

import request from '@/utils/request.js';
import { HTTP_REQUEST_URL } from '@/config/index.js';

const api = {}

// 地址列表
api.getList = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/address/index',
	data: data,
})

// 添加地址
api.add = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/address/add',
	data: data,
})

// 修改地址
api.edit = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/address/edit',
	data: data,
})

// 删除地址
api.delete = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/address/del',
	data: data,
})

// 设置是否默认地址
api.setDefault = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/address/setDefault',
	data: data,
})

// 地址标签列表
api.getTags = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/addressTag/index',
	data: data,
})

// 添加地址标签
api.addTag = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/addressTag/add',
	data: data,
})

// 删除地址标签
api.delTag = data => request.globalRequest({
	methods: 'POST',
	url: HTTP_REQUEST_URL + '/client/addressTag/del',
	data: data,
})

export default api